package day03.homework.standard;

public class FuZhiOper4 {
    public static void main(String[] args) {
        System.out.println("1.声明一个整型变量，演示扩展赋值+=、-=、*=、/=、%=的效果");
        int a = 5;
        a += 10;//a=(int)(a+10)
        System.out.println(a);// 15
        a -= 3;// a=(int)(a-3)
        System.out.println(a);// 12
        a *= 4;// a=(int)(a*4)
        System.out.println(a);// 48
        a /= 2;// a=(int)(a/2)
        System.out.println(a);// 24
        a %= 3;// a=(int)(a%3)
        System.out.println(a);// 0

        System.out.println("2.声明short型变量s，演示简单赋值运算的自增10，演示扩展赋值运算的自增10");
        short s = 12;
        s = (short) (s + 10);
        System.out.println(s);// 22
        s += 10;// s=(short)(s=s+10)=32
        System.out.println(s);


    }
}
